import { _decorator, Component, Sprite, SpriteFrame, UITransform } from "cc"
const { ccclass, property } = _decorator

export const TILE_WITTH = 55
export const TILE_HEIGHT = 55

@ccclass("TileManager")
export class TileManager extends Component {
  init(img: SpriteFrame, i, j) {
    const sprite = this.addComponent(Sprite)
    sprite.spriteFrame = img

    const transfrom = this.getComponent(UITransform)
    transfrom.setContentSize(TILE_WITTH, TILE_HEIGHT)

    this.node.setPosition(i * TILE_WITTH, -j * TILE_HEIGHT)
  }

  update(deltaTime: number) {}
}
